package ru.compscicenter.java.calc.operations;

public class IntegerOperations implements Operations<Integer> {

	@Override
	public Integer parese(String s) {
		int r = 0;
		for (char c : s.toCharArray()) {
			r = r * 10 + c - '0';
		}
		return r;
	}

	@Override
	public Integer plus(Integer a, Integer b) {
		return a + b;
	}

	@Override
	public Integer minus(Integer a, Integer b) {
		return a - b;
	}

	@Override
	public Integer mul(Integer a, Integer b) {
		return a * b;
	}

	@Override
	public Integer div(Integer a, Integer b) {
		return a / b;
	}

}
